/*
 * @Date: 2021-08-14 17:03:26
 * @information:
 */
import Util from '../utils/util'
import UserDao from '../dao/UserDao'

const userDao = new UserDao()


export default class UserService {
  async findById (data) {
    const { id } = data
    const res = await userDao.findById({ id })
    return res
  }

  async add (data) {
    const { username, sex, avatarUrl, phone, desc } = data
    let obj = { username, sex, avatarUrl, phone, desc }
    Util.delNotKey(obj)
    Util.checkObj(obj, ['username'])
    const res = await userDao.add(obj)
    return res
  }




}






